import * as fgui from "fairygui-cc";
import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { IAwake } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { IDestroy } from "../../../../../Core/Module/EventSystem/IDestroySystem";
import { Log } from "../../../../../Core/Module/Log/Log";
import { PanelId } from "../../Demo/FUIAutoGen/PanelId";
import { PanelCoreData } from "./PanelDataDefine";

export class FUIEntity extends Entity implements IAwake, IDestroy {

    public get IsPreLoad(): boolean {
        return this.GComponent != null;
    }

    public get PanelId(): PanelId {
        if (this.panelId == PanelId.Invalid) {
            Log.Error("panel id is " + PanelId.Invalid);
        }
        return this.panelId;
    }

    public set PanelId(value: PanelId) {
        this.panelId = value;
    }

    private panelId = PanelId.Invalid;

    public GComponent: fgui.GComponent;

    public PanelCoreData: PanelCoreData;

    public ContextData: Entity;

    public Language: string;

    public IsUsingStack: boolean;

}